package com.example.order.mapper;

import com.example.model.domain.entity.order.PaymentInfo;
import org.apache.ibatis.annotations.Param;

/**
 * @Author juzipi
 * @Date 2021/7/26 8:33
 * @Info
 */
public interface PaymentMapper {


    /**
     * 查询支付信息
     * @param orderId 订单id
     * @param paymentType 支付方式
     * @return
     */
    PaymentInfo selectPaymentInfoByOrderIdAndPaymentType(@Param("orderId") Long orderId,@Param("paymentType") Integer paymentType);


    /**
     * 保存支付信息
     * @param paymentInfo
     * @return
     */
    Integer insertPaymentInfo(PaymentInfo paymentInfo);

    /**
     * 查询支付信息
     * @param outTradeNo
     * @param paymentType
     * @return
     */
    PaymentInfo selectPaymentInfoByOutTradeNoAndPaymentType(@Param("outTradeNo") String outTradeNo,@Param("paymentType") Integer paymentType);


    /**
     * 更新订单信息
     * @param paymentInfo
     * @return
     */
    Integer updatePaymentInfo(PaymentInfo paymentInfo);
}
